package com.flycard.order.feign.fallback;

import com.flycard.order.feign.ProductFeignClient;
import com.flycard.product.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
@Component
public class ProductFeignClientFallBack implements ProductFeignClient {

    @Override
    public Product getProductById(Long id) {
        System.out.println("兜底回调");
        Product product = new Product();

        product.setId(id);
        product.setName("苹果" + id);
        product.setNum(0);
        product.setPrice(BigDecimal.valueOf(0));
        return product;
    }
}
